<?xml version="1.0" encoding="ISO-8859-1"?>
<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:pcc="http://java.sun.com/jsf/composite/pcc"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:icecore="http://www.icefaces.org/icefaces/core"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
    xmlns:fmt="http://java.sun.com/jsp/jstl/fmt">
	
	<ice:panelGrid styleClass="ui-dialog-content formulario" id="nodoFormWrapper" visible="#{fcTabsProyecto.tabbedTreeProyectoVisible}" rendered="#{fcTabsProyecto.tabbedTreeProyectoVisible}">			 
		<script type="text/javascript">        
            var chart;
            
            var chartData = #{fcTreeProyecto.strCharData};
            
            
            function paintChart() 
            {
                chart = new AmCharts.AmRadarChart();
                
                chart.dataProvider = chartData;
                chart.categoryField = "direction";
                chart.startDuration = 1;
                
                var graphEsperado = new AmCharts.AmGraph();
                graphEsperado.lineColor="#000000";
                graphEsperado.fillAlphas= 0.4;
                graphEsperado.bullet="round";
                graphEsperado.valueField="esperado";
                graphEsperado.balloonText="[[category]]: [[value]]";
                graphEsperado.title="${messages['leyenda.valorEsperado']}";
                chart.addGraph(graphEsperado);
                
                var graphValue = new AmCharts.AmGraph();
                graphValue.lineColor="#FFCC00"
                graphValue.fillAlphas= 0.4;
                graphValue.bullet="round";
                graphValue.valueField="value";
                graphValue.balloonText="[[category]]: [[value]]";
                graphValue.title="${messages['leyenda.valorObtenido']}";
                chart.addGraph(graphValue);
                
                var valAxis = new AmCharts.ValueAxis();
                valAxis.gridType="circles";
                valAxis.fillAlpha= 0.05;
                valAxis.fillColor = "#000000";
                valAxis.axisAlpha = 0.2;
                valAxis.gridAlpha = 0;
                valAxis.fontWeight = "bold";
                valAxis.minimum = 0;
                chart.addValueAxis(valAxis);
                
//                 var guide = new AmCharts.Guide();
//                 guide.angle = 225;
//                 guide.tickLength = 0;
//                 guide.toAngle = 315;
//                 guide.value = 0;
//                 guide.toValue = 14;
//                 guide.fillColor = "#0066CC";
//                 guide.fillAlpha= 0.6
//                 valAxis.addGuide(guide);
                
                
//                 var guide = new AmCharts.Guide();
//                 guide.angle = 45;
//                 guide.tickLength = 0;
//                 guide.toAngle = 135;
//                 guide.value = 0;
//                 guide.toValue = 14;
//                 guide.fillColor = "#CC3333";
//                 guide.fillAlpha = 0.6;
//                 valAxis.addGuide(guide);
                
                var legend = new AmCharts.AmLegend();
                chart.addLegend(legend);
                
                chart.write("chartdiv");
            }
        </script>            
        <div id="chartdiv" style="width:500px; height:400px;"></div>
        <script type="text/javascript">
        	paintChart();
        </script> 
    </ice:panelGrid>
</ui:composition>